#pragma once

#include <chrono>

namespace icesp
{
    struct timer
    {
        // and other clock e.g. system_clock, steady_clock
        using clock_type = std::chrono::high_resolution_clock;
        using time_point_type = std::chrono::time_point<clock_type>;
        using time_type = double;
        using elapsed_type = time_type;
        using duration_type = std::chrono::duration<elapsed_type>;

        void start();
        void stop();
        void reset();
        elapsed_type elapsed_seconds() const;

    private:
        time_point_type _start;
        time_point_type _end;
        elapsed_type tot;
    };
}

